package com.job.ming.Zuoye0711.oop0711;

import java.util.Objects;

/**
 * @author Yangmingyu
 * @version 1.0
 * @since 2022-07-11 16:12:06
 */
public class Cup {
    private String name;
    private Double price;//引用类型 可以接收null
    private Double capacity;
    private String color;

    //public String toString(){
       // return

    //}


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Cup cup = (Cup) o;
        return Objects.equals(name, cup.name) &&
                Objects.equals(price, cup.price) &&
                Objects.equals(capacity, cup.capacity) &&
                Objects.equals(color, cup.color);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, price, capacity, color);
    }

    public Cup(String name, Double price, Double capacity, String color) {
        this.name = name;
        this.price = price;
        this.capacity = capacity;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getCapacity() {
        return capacity;
    }

    public void setCapacity(Double capacity) {
        this.capacity = capacity;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Cup(){

    }
}